package co.edu.usbcali.egrapico.vista.tools;

import co.edu.usbcali.egrapico.vista.ambient.PanelObject;

public class ObjectAtList implements java.io.Serializable {

    private String id;
    private boolean ban = false;
    private PanelObject frame;

    /**
     * Creates a new instance of ObjectAtList
     */
    public ObjectAtList(ObjectAtList ob) {
        id = ob.getID();
        frame = new PanelObject(ob.getFrame());
        frame.setNameObject(id);
    }

    public ObjectAtList(String i) {
        id = i;
        frame = new PanelObject();
        frame.setNameObject(id);
    }

    public Object Clonacion() {
        try {
            return clone();
        } catch (CloneNotSupportedException e) {
            return null;
        }
    }

    public void setID(String i) {
        id = i;
    }

    public boolean iscreateObject() {
        return frame.isCreateObject();
    }

    public String getID() {
        return id;
    }

    public void setVisible(boolean b) {
        frame.setVisible(b);
    }

    public void setSelected(boolean b) {
        try {
            frame.setSelected(b);
        } catch (java.beans.PropertyVetoException e) {
        }
    }

    public PanelObject getFrame() {
        return frame;
    }

    public void mostrarPropertiesFrame() {
        frame.mostrarProperties();
    }

    public void mostratSender() {
        frame.mostrarPrecedent();
    }

    public void mostrarForward() {
        frame.mostrarConsecuent();
    }

    public int getMethodCount() {
        return frame.getMethodCountL();
    }

    public MethodList getMethod(int n) {
        return frame.getMethodL(n);
    }

    public boolean isAddToDesktop() {
        return ban;
    }

    public void setToDesktop() {
        ban = true;
    }

    public void reloadMethod(String lastMethod, MethodList NewMethod) {
    }

    public boolean parsingC(String idO) {
        for (int i = 0; i < getMethodCount(); i++) {
            if (getMethod(i).parsingC(idO)) {
                return true;
            }
        }
        return false;
    }
}